package com.gjy.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-09-27 17:03:27
 */
@Configuration
public class MinioConfig {

    @Value("${custom.minio.endpoint}")
    private String endpoint;
    @Value("${custom.minio.user}")
    private String user;
    @Value("${custom.minio.password}")
    private String password;

    /**
     * 获取 Minio 的客户端类，如果失败则抛出异常
     *
     * @return MinioClient
     */
    /*@Bean(value = "minio")
    public MinioClient minio() {
        try {
            return MinioClient.builder()
                    .endpoint(new URL(endpoint))
                    .credentials(user, password)
                    .build();
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }*/
}